home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C ++ / Frameworks / MacZoop 1.6.5 / Basic Classes / Z Headers / ZClipboard.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-26  |  2.0 KB  |  83 lines  |  [TEXT/CWIE]

  1. /*************************************************************************************************
  2. *
  3. *
  4. *            ObjectMacZapp    -- a standard Mac OOP application template
  5. *
  6. *
  7. *
  8. *            ZClipboard.h    -- the clipboard object
  9. *
  10. *
  11. *
  12. *
  13. *
  14. *            © 1997, Graham Cox
  15. *
  16. *
  17. *
  18. *
  19. *************************************************************************************************/
  20.  
  21. #pragma once
  22.  
  23. #ifndef __ZCLIPBOARD__
  24. #define __ZCLIPBOARD__
  25.  
  26. #ifndef __ZCOMRADE__
  27. #include    "ZComrade.h"
  28. #endif
  29.  
  30. class    ZClipboard;
  31.  
  32. extern ZClipboard*    gClipboard;
  33.  
  34.  
  35. class    ZClipboard : public ZComrade
  36. {
  37. public:
  38.     ZClipboard() : ZComrade() { gClipboard = this; };
  39.     ~ZClipboard() {};
  40.  
  41. // putting data on the clipboard
  42.     virtual void    PutData( OSType dataType, Handle someData );
  43.     virtual void    PutData( OSType dataType, Ptr dataPtr, const long dataLen );
  44.     virtual void    PutData( PicHandle aPicture );
  45.     virtual void    PutText( Handle textH );
  46.     virtual void    PutText( Ptr charBuf, const long textLen );
  47.     
  48.     virtual void    AppendData( OSType dataType, Handle someData );
  49.     virtual void    AppendData( OSType dataType, Ptr dataPtr, const long dataLen );
  50.     virtual void    AppendData( PicHandle aPicture );
  51.     virtual void    AppendText( Handle textH );
  52.     virtual void    AppendText( Ptr charBuf, const long textLen );
  53.     
  54. // clearing the clipboard
  55.     virtual void    Clear();
  56.     
  57. // getting data and info
  58.     virtual Handle    GetData( OSType dataType );
  59.     virtual Boolean    QueryType( OSType dataType );
  60.     virtual long    GetDataSize( OSType dataType );
  61.     virtual short    GetClipStatus();
  62.     
  63. // private scrap conversion
  64.     virtual void    ConvertFromPrivate() {};
  65.     virtual void    ConvertToPrivate() {};
  66. };
  67.  
  68. // this object is a "wrapper" for clipboard storage ops. This class implements its behaviour
  69. // using the standard desk scrap. You can subclass it for private scrap schemes.
  70.  
  71. // ZClipboard transmits the following messages to is comrades:
  72.  
  73. enum
  74. {
  75.     clipContentsChanged = 'clp1',
  76.     clipContentsAppended,
  77.     clipContentsCleared,
  78.     clipDataConverted
  79. };
  80.  
  81. // hint: these can be used to inform a "clipboard window" to update itself.
  82.  
  83. #endif